﻿using System.Collections;
using System.Collections.Generic;
using TMPro;
using UnityEngine;

namespace ZGameFramework
{
    public static class MonoTools
    {

        /// <summary>
        /// 设置物体 的活动状态
        /// </summary>
        /// <param name="gameObject"></param>
        /// <param name="isActive"></param>
        public static void SetActive(GameObject gameObject, bool isActive)
        {
            if (null == gameObject)
            {
                return;
            }
            gameObject.SetActive( isActive );

        }

        /// <summary>
        /// 获取物体 的活动状态
        /// </summary>
        /// <param name="gameObject"></param>
        /// <returns></returns>
        public static bool GetActive(GameObject gameObject)
        {
            if (null == gameObject)
            {
                return false;
            }
            return gameObject.activeInHierarchy;
        }

    }
}
